﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Style x:Key="TeamMemberNameLabel" TargetType="{x:Type TextBlock}">
        <Setter Property="FontSize" Value="24" />
        <Setter Property="Margin" Value="3,0" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Bottom" />
        <Setter Property="FontWeight" Value="Bold" />
        <Setter Property="Effect">
            <Setter.Value>
                <DropShadowEffect ShadowDepth="5" BlurRadius="5" Opacity="0.5" />
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="InfoLabel" TargetType="{x:Type TextBlock}">
        <Setter Property="FontSize" Value="28" />
        <Setter Property="FontWeight" Value="Light" />
        <Setter Property="Opacity" Value="0.7" />
        <Setter Property="Padding" Value="5" />
        <Setter Property="HorizontalAlignment" Value="Right" />
        <Setter Property="VerticalAlignment" Value="Bottom" />
    </Style>

    <Style x:Key="NumericValueLabel" TargetType="{x:Type TextBlock}">
        <Setter Property="FontStyle" Value="Italic" />
        <Setter Property="Padding" Value="5" />
        <Setter Property="FontSize" Value="28" />
        <Setter Property="HorizontalAlignment" Value="Right" />
        <Setter Property="VerticalAlignment" Value="Bottom" />
    </Style>

    <LinearGradientBrush x:Key="LinearSeparatorLineBrush">
        <GradientStop Color="#FF000000" Offset="1"/>
        <GradientStop Color="#00FFFFFF" Offset="0"/>
    </LinearGradientBrush>

    <RadialGradientBrush x:Key="SeparatorLineBrush">
        <GradientStop Color="#FF000000" Offset="0"/>
        <GradientStop Color="#C0000000" Offset="0.75"/>
        <GradientStop Color="#10FFFFFF" Offset="1"/>
    </RadialGradientBrush>

    <Style x:Key="BaseTeamMemberStyle" TargetType="{x:Type FrameworkElement}">
        <!-- Create a drop shadow. This is a very expensive effect, very noticeable in the animations. -->
        <Setter Property="Effect">
            <Setter.Value>
                <DropShadowEffect BlurRadius="5" Color="Black" ShadowDepth="10" Opacity="0.3" />
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="GlowOnUpdateStyle" TargetType="{x:Type FrameworkElement}">
        <!-- Create a glow effect -->
        <Setter Property="Effect">
            <Setter.Value>
                <DropShadowEffect BlurRadius="0" Color="Gold" ShadowDepth="0" />
            </Setter.Value>
        </Setter>

        <Style.Triggers>
            <DataTrigger Binding="{Binding RecentlyUpdated}" Value="True">
                <DataTrigger.EnterActions>
                    <BeginStoryboard Name="GlowStoryboard">
                        <Storyboard>
                            <!-- Animate the BlurRadius to 60 over two seconds. -->
                            <DoubleAnimation Duration="00:00:02" Storyboard.TargetProperty="Effect.BlurRadius" To="60" />
                            <!-- Animate the BlurRadius to 20 over two seconds. -->
                            <DoubleAnimation BeginTime="00:00:02" Duration="00:00:02" Storyboard.TargetProperty="Effect.BlurRadius" To="20" />
                            <ParallelTimeline BeginTime="00:00:04" AutoReverse="True" RepeatBehavior="Forever">
                                <!-- Animate the BlurRadius to 60 and back over two seconds. -->
                                <DoubleAnimation Duration="00:00:02" Storyboard.TargetProperty="Effect.BlurRadius" To="60" />
                                <!-- Animate the Color to White and back over two seconds. -->
                                <ColorAnimation Duration="00:00:02" Storyboard.TargetProperty="Effect.Color" To="White" />
                            </ParallelTimeline>
                        </Storyboard>
                    </BeginStoryboard>
                </DataTrigger.EnterActions>
                <DataTrigger.ExitActions>
                    <StopStoryboard BeginStoryboardName="GlowStoryboard" />
                    
                    <BeginStoryboard>
                        <Storyboard>
                            <ParallelTimeline>
                                <!-- Animate the BlurRadius to 0 over five seconds. -->
                                <DoubleAnimation Duration="00:00:05" Storyboard.TargetProperty="Effect.BlurRadius" To="0"/>
                                <!-- Animate the Color to Gold over two seconds. -->
                                <ColorAnimation Duration="00:00:05" Storyboard.TargetProperty="Effect.Color" To="Gold" />
                            </ParallelTimeline>
                        </Storyboard>
                    </BeginStoryboard>
                </DataTrigger.ExitActions>
            </DataTrigger>
        </Style.Triggers>
    </Style>
    
    <ControlTemplate x:Key="GlassPanel" TargetType="{x:Type UserControl}">
        <Border x:Name="border" Background="Transparent" BorderBrush="#7F000000" BorderThickness="1,1,1,1" CornerRadius="2,32,2,32">
            <Grid>
                <Border CornerRadius="2,32,2,32" Background="{TemplateBinding Background}" />

                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="0.507*"/>
                        <RowDefinition Height="0.493*"/>
                    </Grid.RowDefinitions>
                    <Border Opacity="0" HorizontalAlignment="Stretch" x:Name="glow" Width="Auto" Grid.RowSpan="2" CornerRadius="2,32,2,32">
                        <Border.Background>
                            <RadialGradientBrush>
                                <RadialGradientBrush.RelativeTransform>
                                    <TransformGroup>
                                        <ScaleTransform ScaleX="1.702" ScaleY="2.243"/>
                                        <SkewTransform AngleX="0" AngleY="0"/>
                                        <RotateTransform Angle="0"/>
                                        <TranslateTransform X="-0.368" Y="-0.152"/>
                                    </TransformGroup>
                                </RadialGradientBrush.RelativeTransform>
                                <GradientStop Color="#B28DBDFF" Offset="0"/>
                                <GradientStop Color="#008DBDFF" Offset="1"/>
                            </RadialGradientBrush>
                        </Border.Background>
                    </Border>

                    <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" Width="Auto" Grid.RowSpan="2"/>
                    <Border HorizontalAlignment="Stretch" Margin="0,0,0,0" x:Name="shine" Width="Auto" CornerRadius="2,32,0,0">
                        <Border.Background>
                            <LinearGradientBrush EndPoint="0.494,0.889" StartPoint="0.494,0.028">
                                <GradientStop Color="#99FFFFFF" Offset="0"/>
                                <GradientStop Color="#33FFFFFF" Offset="1"/>
                            </LinearGradientBrush>
                        </Border.Background>
                    </Border>
                </Grid>
            </Grid>
        </Border>
    </ControlTemplate>
</ResourceDictionary>